<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>统计管理</title>
	<meta name="decorator" content="default"/>
	<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#awardType").val('${awardType}');
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		
		<li <c:if test="${awardType eq 'exchange' }">class="active"</c:if> <c:if test="${empty awardType   }">class="active"</c:if>><a href="${ctx}/wechat/statics/st?awardType=exchange">兑换统计</a></li>
		<li <c:if test="${awardType eq 'lottery' }">class="active"</c:if>><a href="${ctx}/wechat/statics/st?awardType=lottery">抽奖统计</a></li>
		<li <c:if test="${awardType eq 'seckill' }">class="active"</c:if>><a href="${ctx}/wechat/statics/st?awardType=seckill">秒杀统计</a></li>
		<li <c:if test="${awardType eq 'share' }">class="active"</c:if>><a href="${ctx}/wechat/statics/st?awardType=share">转发统计</a></li>
	</ul>
	<form id="searchForm"   action="${ctx}/wechat/statics/st" method="post" class="breadcrumb form-search">
		<label>类型 ：</label>
			<select name="awardType" id="awardType" class="input-medium">
				<option value="lottery">在线抽奖</option>
				<option value="share">有奖转发</option>
				<option value="exchange">积分兑换</option>
				<option value="seckill">超值秒杀</option>
			</select>
		<label>日期 ：</label>
					<input id="queryDay" name="day" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="<fmt:formatDate value="${seckill.startTime}" pattern="yyyyMMdd"/>"
						onclick="WdatePicker({dateFmt:'yyyyMMdd',isShowClear:false});"/>
		<label>月份 ：</label> <input  id="queryMonth" name="month" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="<fmt:formatDate value="${seckill.startTime}" pattern="yyyyMM"/>"
						onclick="WdatePicker({dateFmt:'yyyyMM',isShowClear:false});"/>
		 <input type="radio" name="queryType" value="day"  <c:if test="${queryType eq 'day' }">checked="checked"</c:if>   >按日 &nbsp;  <input type="radio" name="queryType" value="month" <c:if test="${queryType eq 'month' }">checked="checked"</c:if> > 按月  
		&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form>
	<tags:message content="${message}"/>
	
 	
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
		<shiro:hasPermission name="sys:user:edit"><th>所属商家</th></shiro:hasPermission>
			<th>名称</th>
			<th>状态</th>
			<th>数量</th>
			<th>月份</th>
			<c:if test="${queryType eq 'day' }"><th>日期</th> </c:if> 
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${statics}" var="stat">
			<tr>
				<shiro:hasPermission name="sys:user:edit"><td>${stat.user_name}</td></shiro:hasPermission>
				<td>
				
					<c:if test="${stat.award_type eq 'lottery'}"><a href="${ctx }/wechat/lotteryRecord/?lottery.user.id=${stat.user_id}&lottery.status=${STATUS}">在线抽奖</a>	</c:if>
					<c:if test="${stat.award_type eq 'share'}"><a href="${ctx }/wechat/share/circleShare/?circleShare.user.id=${stat.user_id}&circleShare.status=${STATUS}">有奖转发</a></c:if>
					<c:if test="${stat.award_type eq 'exchange'}"><a href="${ctx }/score/exchangeRecord/?exchangeRecord.user.id=${stat.user_id}&exchangeRecord.status=${STATUS}">积分兑换</a></c:if>
					<c:if test="${stat.award_type eq 'seckill'}"><a href="${ctx }/score/exchangeRecord/?exchangeRecord.user.id=${stat.user_id}&exchangeRecord.status=${STATUS}">在线秒杀</a></c:if>
				
				</td>
				<td><c:if test="${stat.STATUS eq 0}">未使用</c:if> <c:if test="${stat.STATUS eq 1}">已使用</c:if><c:if test="${stat.STATUS eq 2}">已作废使用</c:if></td>
				<td>	
					${stat.cnt}
				</td>
				<td>${stat.MONTH}</td>
				
				<c:if test="${queryType eq 'day' }"><td>${stat.DAY}</td> </c:if>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</body>
</html>
